using System;

namespace SharpMud.MudLib.SAMPLE.Commands.Metadata
{
	/// <summary>
	/// Outlines criteria that a character must match to be able to see a command on the command list.
	/// Visibility requirements are not to be confused with execution requirements.
	/// </summary>
	public abstract class VisibilityRequirementAttribute
	{	
		private Entities.Filtration.ICharacterFilter _Filter;

		protected VisibilityRequirementAttribute()
		{
		}

		public VisibilityRequirementAttribute(Entities.Filtration.ICharacterFilter filter)
		{
			_Filter = filter;
		}

		protected virtual bool _AllowsVisibilityTo(Entities.ICharacter character)
		{
			return _Filter.DoesCharacterPass(character);
		}

		public bool AllowsVisibilityTo(Entities.ICharacter character)
		{
			return _AllowsVisibilityTo(character);
		}
	}
}
